package com.gz.mylife.im;

import android.os.Parcel;
import android.os.Parcelable;
import net.tsz.afinal.annotation.sqlite.Id;
import net.tsz.afinal.annotation.sqlite.Property;
import net.tsz.afinal.annotation.sqlite.Table;
import net.tsz.afinal.annotation.sqlite.Transient;

@Table(name="tb_photo")
public class Photo implements Parcelable {
	
	@Id
	private int id;
	@Property
	private int uid;
	@Property
	private int photoId;
	@Property
	private String url;
	@Property
	private int width;
	@Property
	private int height;
	@Transient
	private boolean isTempAdd;

	@Transient
	private boolean selected;
	
	@Transient
	private boolean isFace;

	public Photo() {
		
	}
	
	public Photo(Parcel source) {
		id = source.readInt();
		uid = source.readInt();
		photoId = source.readInt();
		width = source.readInt();
		height = source.readInt();
		url = source.readString();
	}
	
	public int getUid() {
		return uid;
	}

	public void setUid(int uid) {
		this.uid = uid;
	}
	
	public boolean isSelected() {
		return selected;
	}

	public void setSelected(boolean selected) {
		this.selected = selected;
	}
	
	public boolean isTempAdd() {
		return isTempAdd;
	}

	public void setTempAdd(boolean isTempAdd) {
		this.isTempAdd = isTempAdd;
	}
	
	public boolean isFace() {
		return isFace;
	}

	public void setFace(boolean isFace) {
		this.isFace = isFace;
	}
	
	public int getPhotoId() {
		return photoId;
	}
	public void setPhotoId(int photoId) {
		this.photoId = photoId;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public int getWidth() {
		return width;
	}
	public void setWidth(int width) {
		this.width = width;
	}
	public int getHeight() {
		return height;
	}
	public void setHeight(int height) {
		this.height = height;
	}
	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(id);
		dest.writeInt(uid);
		dest.writeInt(photoId);
		dest.writeInt(width);
		dest.writeInt(height);
		dest.writeString(url);
	}
	
	public static final Parcelable.Creator<Photo> CREATOR = new Creator<Photo>() {
		
		@Override
		public Photo[] newArray(int size) {
			// TODO Auto-generated method stub
			return new Photo[size];
		}
		
		@Override
		public Photo createFromParcel(Parcel source) {
			// TODO Auto-generated method stub
			return new Photo(source);
		}
	};
}
